package com.ryder.book_cycle.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ryder.book_cycle.entity.Book;
import com.ryder.book_cycle.entity.MerchantProfile;
import com.ryder.book_cycle.mapper.BookMapper;
import com.ryder.book_cycle.mapper.MerchantProfileMapper;
import com.ryder.book_cycle.service.BookService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 描述: 书籍表(Book)表服务实现类
 * 
 * @author Ryder
 * @version 1.0
 * @since 1.0 // 版本号，指明从哪个版本开始
 * 更新日期: 2025-07-09 02:45:23
 */
@Service("bookService")
@RequiredArgsConstructor
public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements BookService {

    private final MerchantProfileMapper merchantProfileMapper;

    @Override
    public boolean existsMerchantId(Long id) {
        return merchantProfileMapper.exists(new LambdaQueryWrapper<MerchantProfile>()
                .eq(MerchantProfile::getMerchantId, id));
    }
}
